# Read Me

**Replication** files for:

Cassy Dorff, "Victimization and Agency Attitudes in Mexico." *Comparative Political Studies*. Forthcoming.

Variables and data are described in the appendix for this paper. Replication files are in order in this directory. Make sure to edit the `setup.R` file according to your own pathways. See the information session below for exact R platform information and package versions.

Please reach out to cassy.dorff@vanderbilt.edu with any questions.

**Data files**

- `1_nationalsample_data.rda`: Mexican national survey sample
- `2_oversample_data.rda`: Oversample near autodefensas in Mexico
- the remaining `.rda` files in this folder contain model results

**R scripts**

- `0_setup.R`: set up file for easy library loading and paths. Example desktop pathways are given.
- `1_desc_figure.R`: creates figure 1
- `2_models_run.R`:   runs all of the models (both main text and appendix) and saves them
- `2_models_table.R`: creates .tex output for each model and saves it
- `3_models_figures.R`: creates the graphs for all models (both main text and appendix) and saves each graph
- `4_tables_appendix.R`: creates additional descriptive tables for appendix



**Session Info**

    > sessionInfo()
    R version 4.2.2
    Platform: aarch64-apple-darwin20 (64-bit)
    Running under: macOS 14.4.1

    Matrix products: default
    LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

    locale:
    [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base

    other attached packages:
     [1] haven_2.5.1            knitr_1.41             MNP_3.1-4              mlogit_1.1-1           dfidx_0.0-5
     [6] pscl_1.5.5.1           reshape2_1.4.4         lmtest_0.9-40          zoo_1.8-11             lubridate_1.9.2
    [11] forcats_1.0.0          stringr_1.5.1          purrr_1.0.1            readr_2.1.5            tidyr_1.3.1
    [16] tibble_3.2.1           tidyverse_2.0.0        pROC_1.18.4            ROCR_1.0-11            marginaleffects_0.13.0
    [21] gridExtra_2.3          dplyr_1.1.2            stargazer_5.2.3        ggplot2_3.5.1          xtable_1.8-4
    [26] nnet_7.3-18            MASS_7.3-58.1          foreign_0.8-83

    loaded via a namespace (and not attached):
     [1] Rcpp_1.0.12       lattice_0.20-45   utf8_1.2.4        R6_2.5.1          plyr_1.8.9        backports_1.5.0   pillar_1.9.0
     [8] Rdpack_2.4        rlang_1.1.3       rstudioapi_0.14   data.table_1.14.6 checkmate_2.3.1   textshaping_0.3.6 labeling_0.4.3
    [15] statmod_1.5.0     munsell_0.5.1     compiler_4.2.2    xfun_0.35         pkgconfig_2.0.3   systemfonts_1.0.4 insight_0.19.3
    [22] tidyselect_1.2.1  fansi_1.0.6       tzdb_0.4.0        withr_3.0.0       rbibutils_2.2.13  grid_4.2.2        gtable_0.3.5
    [29] lifecycle_1.0.4   magrittr_2.0.3    scales_1.3.0      cli_3.6.2         stringi_1.8.4     farver_2.1.2      ellipsis_0.3.2
    [36] ragg_1.3.0        generics_0.1.3    vctrs_0.6.5       Formula_1.2-4     tools_4.2.2       glue_1.7.0        hms_1.1.2
    [43] timechange_0.1.1  colorspace_2.1-0
